<template>
  <el-menu
      :default-active="activeIndex2"
      active-text-color="#A8ABB2"
      background-color="#a0cfff"
      class="el-menu-demo"
      mode="horizontal"
      text-color="#fff"
      @select="handleSelect"
  >
    <el-menu-item index="1">
      <router-link to="/home">
      首页
        </router-link >
    </el-menu-item>

    <el-menu-item disabled index="2">帮助与支持</el-menu-item>
    <el-menu-item index="3">
      <router-link to="/">
      退出
      </router-link >
    </el-menu-item>


    <div class="avatar">
      <div class="block">
        <el-dropdown>
          <el-avatar :size="55"/>
          <template #dropdown>
            <el-dropdown-menu>
              <el-dropdown-item>退出</el-dropdown-item>
              <el-dropdown-item>个人中心</el-dropdown-item>
            </el-dropdown-menu>
          </template>
        </el-dropdown>
      </div>
    </div>


  </el-menu>


  <el-row>
    <el-col :span="3">
      <h4 class="mb-2">水电费预缴费管理系统</h4>
      <el-menu
          class="el-menu-vertical-demo"
          default-active="2"
          @close="handleClose"
          @open="handleOpen"
      >
        <el-menu-item index="1">
          <el-icon>
            <icon-menu/>
          </el-icon>
          <router-link to="/message">
          <span>消息中心</span>
          </router-link>
        </el-menu-item>
        <el-sub-menu index="2">
          <template #title>
            <el-icon>
              <location/>
            </el-icon>
            <span>预缴费</span>
          </template>

          <el-menu-item>
            <router-link to="/history">
            预缴费历史记录
            </router-link >
          </el-menu-item>
          <el-menu-item>
            <router-link to="/prepay">
            余额查询(支付)
            </router-link >
          </el-menu-item>
        </el-sub-menu>
        <el-menu-item index="3">
          <el-icon>
            <icon-menu/>
          </el-icon>
          <router-link to="/bill">
            账单
          </router-link >
        </el-menu-item>
        <el-menu-item index="4">
          <el-icon>
            <icon-menu/>
          </el-icon>
          <router-link to="/water">
            水费单价
          </router-link >
        </el-menu-item>
        <el-menu-item index="5">
          <el-icon>
            <icon-menu/>
          </el-icon>
          <router-link to="/electric">
            电费单价
          </router-link >
        </el-menu-item>
        <el-menu-item index="6">
          <el-icon>
            <setting/>
          </el-icon>
          <span>
            <router-link to="/user/user">
              个人信息
              </router-link>
          </span>
        </el-menu-item>
      </el-menu>
    </el-col>

    <router-view></router-view>

  </el-row>



</template>

<script>

import {defineComponent} from "vue";
import {Document, Location, Setting} from "@element-plus/icons-vue";
import { RouterLink } from 'vue-router';
export default defineComponent({
  components: {Location, Document, Setting,RouterLink},
  data() {
    return {
      message: '/message',
      user_info: '/user/user',
      home: '/home',
      quit:'/',
    waterPrice:'/water',
      electricPrice:'/electric',
      bill:'/bill',
      history:'/history'
    };
  },
})

</script>

<style scoped>

.mb-2{
  margin-top: 50px;
  margin-left: 10px;
}

.avatar {
  //border: #4d4343 solid 1px;
  width: 79%;
  display: flex;
  justify-content: flex-end;
}
</style>
